//
//  UIButtonEnums.swift
//  Documentation
//
//  Created by Toj on 7/28/23.
//

import Foundation

extension UIButton {

    // 按钮类型:
    public enum ButtonType : Int {

        case custom = 0 // 默认, 其他几乎不用

        @available(iOS 7.0, *)
        case system = 1

        case detailDisclosure = 2

        case infoLight = 3

        case infoDark = 4

        case contactAdd = 5

        @available(iOS 13.0, *)
        case close = 7

        public static var roundedRect: UIButton.ButtonType { get }
    }

    @available(iOS 14.0, *)
    public enum Role : Int {

        case normal = 0

        case primary = 1

        case cancel = 2

        case destructive = 3
    }

    @available(iOS 15.0, *)
    public typealias ConfigurationUpdateHandler = (UIButton) -> Void
}
